import meteoroHomeApi from '@/service/home.js';
const temporaryWeather = {
    data() {
        return {

        }
    },
    mounted() {

    },
    components: {

    },
    methods: {
        //临时数据，通过ip获取
        initTemporaryData() {
            meteoroHomeApi.get_24jx_GetIp({}).then(res => {
                console.log(res);
            }).catch(error => {
                console.log('error', error)
            })
        },
        //临时数据，获取地区编号
        initGetCitys() {
            var params = {
                title: "迎泽"
            }
            meteoroHomeApi.getCitys(params).then(res => {
                console.log(res);
                if (res.data.length != 0) {
                    this.initGetWeather(res.data[0]);
                }
            }).catch(error => {
                console.log('error', error)
            })
        },
        //临时数据，根据地区编号，获取天气情况
        initGetWeather(titleId) {
            var params = {
                title: titleId.id
            }
            meteoroHomeApi.getWeather(params).then(res => {
                console.log(res);
            }).catch(error => {
                console.log('error', error)
            })
        },
    }
}

export default temporaryWeather
